/**
 * Studys.java
 * Copyright© 2017 北京金风易通科技有限公司
 * All rights reserved.
 * -----------------------------------------------
 * 2017-11-14 Created
 */
package com.jfsoft.demo1114.dao.model;

import java.io.UnsupportedEncodingException;
import java.util.Base64;

/**
 * null
 * 
 * @author wanggang
 * @version 1.0 2017-11-14
 */
public class Studys {

    /**
     */
    private String accessno;

    /**
     */
    private String stuuid;

    /**
     */
    private String stuid;

    /**
     */
    private String studate;

    /**
     */
    private String studesc;

    /**
     */
    private String modality;

    /**
     */
    private String pid;

    /**
     */
    private String pname;

    /**
     */
    private String gender;

    /**
     */
    private String dob;

    /**
     */
    private String age;

    /**
     */
    private String srcaet;

    private String stutime;

    public String getStutime() {
        return stutime;
    }

    public void setStutime(String stutime) {
        this.stutime = stutime == null ? null : stutime.trim();
        if(this.stutime.length()==6){
            this.stutimeStr=this.stutime.substring(0,2)+":"+this.stutime.substring(2,4)+":"+this.stutime.substring(4,6);
        }
    }

    private String genderStr;

    private String studateStr;

    private String ageStr;

    private String studescStr;

    private Integer imagecount;

    private String stutimeStr;

    public String getStutimeStr() {
        return stutimeStr;
    }

    public void setStutimeStr(String stutimeStr) {
        this.stutimeStr = stutimeStr;
    }

    public String getAccessno() {
        return accessno;
    }

    public void setAccessno(String accessno) {
        this.accessno = accessno == null ? null : accessno.trim();
    }

    public String getStuuid() {
        return stuuid;
    }

    public void setStuuid(String stuuid) {
        this.stuuid = stuuid == null ? null : stuuid.trim();
    }

    public String getStuid() {
        return stuid;
    }

    public void setStuid(String stuid) {
        this.stuid = stuid == null ? null : stuid.trim();
    }

    public String getStudate() {
        return studate;
    }

    public void setStudate(String studate) {
        this.studate = studate == null ? null : studate.trim();
        if(this.studate.length()==8){
            this.studateStr=this.studate.substring(0,4)+"-"+this.studate.substring(4,6)+"-"+this.studate.substring(6,8);
        }
    }

    public String getStudesc() {
        return studesc;
    }

    public void setStudesc(String studesc) {
        this.studesc = studesc == null ? null : studesc.trim();
        Base64.Decoder decoder=Base64.getDecoder();
        String str=this.studesc.replaceAll("base64:","");
        try {
            this.studescStr=new String(decoder.decode(str),"UTF-8");
        } catch (UnsupportedEncodingException e) {
            this.studescStr=null;
        }
    }

    public String getModality() {
        return modality;
    }

    public void setModality(String modality) {
        this.modality = modality == null ? null : modality.trim();
    }

    public String getPid() {
        return pid;
    }

    public void setPid(String pid) {
        this.pid = pid == null ? null : pid.trim();
    }

    public String getPname() {
        return pname;
    }

    public void setPname(String pname) {
        this.pname = pname == null ? null : pname.trim();
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender == null ? null : gender.trim();
        if(gender.equals("F")){
            this.genderStr="女";
        }else if(gender.equals("M")){
            this.genderStr="男";
        }
    }

    public String getDob() {
        return dob;
    }

    public void setDob(String dob) {
        this.dob = dob == null ? null : dob.trim();
    }

    public String getAge() {
        return age;
    }

    public void setAge(String age) {
        this.age = age == null ? null : age.trim();
        if(age.indexOf("Y")>0){
            this.ageStr=Integer.parseInt(age.substring(0,age.indexOf("Y")))+"岁";
        }else if(age.indexOf("M")>0){
            this.ageStr=Integer.parseInt(age.substring(0,age.indexOf("M")))+"月";
        }else if(age.indexOf("D")>0){
            this.ageStr=Integer.parseInt(age.substring(0,age.indexOf("D")))+"天";
        }
    }

    public String getSrcaet() {
        return srcaet;
    }

    public void setSrcaet(String srcaet) {
        this.srcaet = srcaet == null ? null : srcaet.trim();
    }

    public String getGenderStr() {
        return genderStr;
    }

    public void setGenderStr(String genderStr) {
        this.genderStr = genderStr;
    }

    public String getStudateStr() {
        return studateStr;
    }

    public void setStudateStr(String studateStr) {
        this.studateStr = studateStr;
    }

    public String getAgeStr() {
        return ageStr;
    }

    public void setAgeStr(String ageStr) {
        this.ageStr = ageStr;
    }

    public String getStudescStr() {
        return studescStr;
    }

    public void setStudescStr(String studescStr) {
        this.studescStr = studescStr;
    }

    public Integer getImagecount() {
        return imagecount;
    }

    public void setImagecount(Integer imagecount) {
        this.imagecount = imagecount;
    }
}
